/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
 * Description: ErrContext 内部封装
 * Author: zhujiale
 * Create: 2023-12-12
 */

#include "adapter_error_manager.h"
#include "adapter_error_manager_pub.h"

ErrContextPub hrtErrMGetErrorContextPub(void)
{
    ErrContext errorContext = hrtErrMGetErrorContext();
    ErrContextPub errorContextPub;
    errorContextPub.work_stream_id = errorContext.work_stream_id;
    errorContextPub.first_stage = errorContext.first_stage;
    errorContextPub.second_stage = errorContext.second_stage;
    errorContextPub.log_header = errorContext.log_header;
    return errorContextPub;
}

void hrtErrMSetErrorContextPub(ErrContextPub errorContextPub)
{
    ErrContext errorContext;
    errorContext.work_stream_id = errorContextPub.work_stream_id;
    errorContext.first_stage = errorContextPub.first_stage;
    errorContext.second_stage = errorContextPub.second_stage;
    errorContext.log_header = errorContextPub.log_header;
    hrtErrMSetErrorContext(errorContext);
}
